<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Calendar" %>
<%@ page import="java.util.Date" %>
<%@ page import="java.util.GregorianCalendar" %>
<%--
  Created by IntelliJ IDEA.
  User: gaoliwei02
  Date: 17/6/25
  Time: 上午10:31
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>user information</title>
</head>

<body>
<!-- Content Header (Page header) -->
<section class="content-header">
  <h1>
    user information
    <small>page</small>
  </h1>
</section>

<!-- Main content -->
<section class="content">
  <div class="box">
    <%--<div class="box-header with-border"></div><!-- /.box-header -->--%>
    <div class="box-body">
      <div class="row">

        <div class="col-lg-2  col-xs-6">
          <label class="username_search" for="username_search">username</label>
          <input type="text" class="form-control" id="username_search" name="username_search"
                 placeholder="">
        </div>

        <div class="col-lg-2  col-xs-6">
          <label class="role_permission_search" for="role_permission_search">role_permission</label>
          <select type="text" class="form-control" id="role_permission_search" name="role_permission_search"
                  placeholder="" onchange="search()">
            <option>all</option>
            <option>1</option>
            <option>2</option>
            <option>3</option>
          </select>
        </div>
      </div>

    </div>
  </div>


  <div class="container removeLeftSpace">
    <div class="removeLeftSpace row">
      <div class="col-xs-2 col-lg-1 removeLeftSpace">
        <button class="btn btn-primary margin" style="width: 100px; margin-left: 0" onclick="search()">
          <i class="fa fa-search" style=" margin-right: 4px;"></i>check
        </button>
      </div>

    </div>
  </div>

  <table id="user_manager_table"
         data-toggle="table"
         data-side-pagination="server"
         data-pagination="true"
  <%--data-search="true"--%>
         data-page-size="15"
         data-page-list="[15, 50, 100, 500]"
  <%--data-url="/static/json/data1.json"--%>
         data-url="/user/getlist.inner"
         data-row-style="rowStyle"
         data-click-to-select="true"
         data-field="state"
         data-method="post"
         data-striped="true">
    <thead>
    <tr>
      <th data-checkbox="true">check</th>
      <th data-field="userName">userName</th>
      <th data-field="lastSignTime">&emsp; &emsp; reportTime&emsp; &emsp; </th>
      <th data-field="RegisterTime">&emsp; &emsp; registerTime&emsp; &emsp; </th>
      <th data-field="signStatus">signStatus</th>
      <th data-field="phoneNumber">phoneNumber</th>
      <th data-field="rolePermission">rolePermission</th>
      <th data-field="ipAddress">ipAddress</th>
      <th data-field="note">note</th>

    </tr>
    </thead>

  </table>

</section>

<script>
  $(document).ready(function(){
    search();
    setInterval("search()", 30000);
  });

  function search() {
    var $table = $('#user_manager_table');
    $table.bootstrapTable('refresh', {
      query: queryParams({
        pageNumber: 1
      })
    });
    setTimeout(function () {
      addHref();
    }, 1000);
  }

  function queryParams(param) {
    var data = {
      pageSize: $(".page-size").text(),
      username: $("#username_search").val(),
      role_permission: $('#role_permission_search').val()
    };
    if (!data.pageSize) {
      data.pageSize = 50;
    }
    $.extend(param, data);
    return param;
  }
</script>